package com.eight.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author 郭坤
 * @since 2023-02-24
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="tbCoupon", description="优惠卷实体类")
@TableName(value = "tb_coupon")
public class TbCoupon implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @TableField(value = "id")
    private Integer id;

    @TableField(value = "shop_id")
    private Long shopId;

    @ApiModelProperty(value = "优惠卷类型；0->全场赠券；1->会员赠券；2->消费赠券；3->注册赠券")
    @TableField(value = "type")
    private Integer type;

    @TableField(value = "cname")
    private String name;

    @ApiModelProperty(value = "数量")
    @TableField(value = "count")
    private Integer count;

    @ApiModelProperty(value = "金额")
    @TableField(value = "amount")
    private BigDecimal amount;

    @ApiModelProperty(value = "每人限领张数")
    @TableField(value = "per_limit")
    private Integer perLimit;

    @ApiModelProperty(value = "使用门槛；0表示无门槛")
    @TableField(value = "min_point")
    private Integer minPoint;

    @TableField(value = "start_time")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime startTime;

    @TableField(value = "end_time")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime endTime;

    @ApiModelProperty(value = "使用类型：0->全场通用；1->指定分类；2->指定车辆")
    @TableField(value = "use_type")
    private Integer useType;

    @ApiModelProperty(value = "备注")
    @TableField(value = "note")
    private String note;

    @ApiModelProperty(value = "发行数量")
    @TableField(value = "publish_count")
    private Integer publishCount;

    @ApiModelProperty(value = "已使用数量")
    @TableField(value = "use_count")
    private Integer useCount;

    @ApiModelProperty(value = "领取数量")
    @TableField(value = "receive_count")
    private Integer receiveCount;

    @ApiModelProperty(value = "可以领取的日期")
    @TableField(value = "enable_time")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime enableTime;

    @ApiModelProperty(value = "优惠码")
    @TableField(value = "code")
    private String code;

    @ApiModelProperty(value = "可领取的会员类型：0->无限时")
    @TableField(value = "member_level")
    private Integer memberLevel;


}
